package com.weetop.aklyscan.presenter;

import android.app.Activity;

import com.weetop.aklyscan.base.mvp.BaseModel;
import com.weetop.aklyscan.base.mvp.BaseObserver;
import com.weetop.aklyscan.base.mvp.BasePresenter;
import com.weetop.aklyscan.bean.SearchItemBean;
import com.weetop.aklyscan.bean.StockPostionBean;
import com.weetop.aklyscan.view.StockSearchView;

import java.util.List;

public class StockSearchPresent extends BasePresenter<StockSearchView> {

    public StockSearchPresent(StockSearchView baseView, Activity activity) {
        super(baseView, activity);
    }

    public void searchList(String code){
        addDisposable(apiServer.scanStockPostion(code), new BaseObserver<BaseModel<StockPostionBean>>(baseView) {
            @Override
            public void onSuccess(BaseModel<StockPostionBean> o) {
                baseView.getSearchResultSuccess(o);
            }

            @Override
            public void onError(String msg) {
                if (baseView != null) {
                    baseView.showError(msg);
                }
            }
        });
    }



}
